---
title: yomo run
---

# yomo run

Run a StreamFunction service.

## Usage

```bash
yomo run [flags] serverless
```

## Flags

- `-d, --credential`: Set the credential when connecting to [Zipper][zipper].
- `-m, --modfile`: Set the path of custom `go.mod` file.
- `-n, --name`: Set the name of the StreamFunction service, it should match the specific name in [Zipper][zipper] config file.
- `-r, --runtime`: Set the runtime of the StreamFunction service, default is WebAssembly by `wazero`, also support `wasmtime`, `wasmedge` and `Deno`
- `-z, --zipper`: Set the address of [Zipper][zipper] to connect.

## Example

Follow [last tutorial: yomo build](./build#example), we created a Stream Function `accumulator-func`, and build it to WebAssembly, and we try run it by `yomo dev`, Now we will run it with `yomo run` command.

```bash
ᐅ yomo run -z tap.yomo.dev:9140 -n yomo-app-demo sfn.wasm

ℹ️  YoMo Stream Function file: sfn.wasm
⌛  Create YoMo Stream Function instance...
ℹ️  Starting YoMo Stream Function instance with executable file: sfn.wasm. Zipper: [tap.yomo.dev:9140].
ℹ️  YoMo Stream Function is running...
time=2023-04-16T22:45:54.265+08:00 level=INFO msg="use credential" component="Stream Function" client_id=jHp0g18hmjk_fL0SvH_6X client_name=yomo-app-demo credential_name=none
time=2023-04-16T22:45:55.461+08:00 level=INFO msg="connected to zipper" component="Stream Function" client_id=jHp0g18hmjk_fL0SvH_6X client_name=yomo-app-demo zipper_addr=tap.yomo.dev:9140
sfn received 58 bytes: {"noise":68.54317,"time":1681656355561,"from":"localhost"}
        ⚡️avg=68.543170
sfn received 59 bytes: {"noise":105.43603,"time":1681656355663,"from":"localhost"}
        ⚡️avg=86.989600
sfn received 59 bytes: {"noise":138.38487,"time":1681656355764,"from":"localhost"}
        ⚡️avg=104.121357
sfn received 58 bytes: {"noise":46.46564,"time":1681656355865,"from":"localhost"}
        ⚡️avg=89.707427
sfn received 59 bytes: {"noise":188.09396,"time":1681656355966,"from":"localhost"}
        ⚡️avg=109.384734
sfn received 58 bytes: {"noise":93.66026,"time":1681656356067,"from":"localhost"}
        ⚡️avg=106.763988
sfn received 59 bytes: {"noise":136.37762,"time":1681656356168,"from":"localhost"}
        ⚡️avg=110.994507
^C
```

The source code of this example can be found at [Github](https://github.com/fanweixiao/yomo-wasi-sfn-demo)

If you want to craft this demo by yourself, you can start your own Zipper Service by [yomo serve](./zipper) and implement your own [Source](/docs/api/source#example).

[zipper]: ./zipper
